<!DOCTYPE html>
<html lang="zh-CN">
<head>
  <meta charset="UTF-8">
<meta name="viewport" content="width=device-width">
<meta name="theme-color" content="#222">
<meta name="generator" content="Hexo 6.2.0">


  <link rel="apple-touch-icon" sizes="180x180" href="/images/apple-touch-icon-next.png">
  <link rel="icon" type="image/png" sizes="32x32" href="/images/favicon-32x32-next.png">
  <link rel="icon" type="image/png" sizes="16x16" href="/images/favicon-16x16-next.png">
  <link rel="mask-icon" href="/images/logo.svg" color="#222">

<link rel="stylesheet" href="/css/main.css">



<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@5.15.3/css/all.min.css" integrity="sha256-2H3fkXt6FEmrReK448mDVGKb3WW2ZZw35gI7vqHOE4Y=" crossorigin="anonymous">
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/animate.css@3.1.1/animate.min.css" integrity="sha256-PR7ttpcvz8qrF57fur/yAx1qXMFJeJFiA6pSzWi0OIE=" crossorigin="anonymous">

<script class="next-config" data-name="main" type="application/json">{"hostname":"singingxy.github.io","root":"/","images":"/images","scheme":"Gemini","version":"8.6.1","exturl":false,"sidebar":{"position":"left","display":"post","padding":18,"offset":12},"copycode":false,"bookmark":{"enable":false,"color":"#222","save":"auto"},"fancybox":false,"mediumzoom":false,"lazyload":false,"pangu":false,"comments":{"style":"tabs","active":null,"storage":true,"lazyload":false,"nav":null},"motion":{"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"fadeInDown","post_body":"fadeInDown","coll_header":"fadeInLeft","sidebar":"fadeInUp"}},"prism":false,"i18n":{"placeholder":"搜索...","empty":"没有找到任何搜索结果：${query}","hits_time":"找到 ${hits} 个搜索结果（用时 ${time} 毫秒）","hits":"找到 ${hits} 个搜索结果"}}</script><script src="/js/config.js"></script>
<meta property="og:type" content="website">
<meta property="og:title" content="sing&#39;s blog">
<meta property="og:url" content="https://singingxy.github.io/index.html">
<meta property="og:site_name" content="sing&#39;s blog">
<meta property="og:locale" content="zh_CN">
<meta property="article:author" content="Sing">
<meta name="twitter:card" content="summary">


<link rel="canonical" href="https://singingxy.github.io/">



<script class="next-config" data-name="page" type="application/json">{"sidebar":"","isHome":true,"isPost":false,"lang":"zh-CN","comments":"","permalink":"","path":"index.html","title":""}</script>

<script class="next-config" data-name="calendar" type="application/json">""</script>
<title>sing's blog</title>
  




  <noscript>
    <link rel="stylesheet" href="/css/noscript.css">
  </noscript>
</head>

<body itemscope itemtype="http://schema.org/WebPage" class="use-motion">
  <div class="headband"></div>

  <main class="main">
    <header class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-brand-container">
  <div class="site-nav-toggle">
    <div class="toggle" aria-label="切换导航栏" role="button">
    </div>
  </div>

  <div class="site-meta">

    <a href="/" class="brand" rel="start">
      <i class="logo-line"></i>
      <h1 class="site-title">sing's blog</h1>
      <i class="logo-line"></i>
    </a>
      <p class="site-subtitle" itemprop="description">C'est La Vie Mon Ami.</p>
  </div>

  <div class="site-nav-right">
    <div class="toggle popup-trigger">
    </div>
  </div>
</div>







</div>
        
  
  <div class="toggle sidebar-toggle" role="button">
    <span class="toggle-line"></span>
    <span class="toggle-line"></span>
    <span class="toggle-line"></span>
  </div>

  <aside class="sidebar">

    <div class="sidebar-inner sidebar-overview-active">
      <ul class="sidebar-nav">
        <li class="sidebar-nav-toc">
          文章目录
        </li>
        <li class="sidebar-nav-overview">
          站点概览
        </li>
      </ul>

      <div class="sidebar-panel-container">
        <!--noindex-->
        <div class="post-toc-wrap sidebar-panel">
        </div>
        <!--/noindex-->

        <div class="site-overview-wrap sidebar-panel">
          <div class="site-overview">
            <div class="site-author site-overview-item animated" itemprop="author" itemscope itemtype="http://schema.org/Person">
  <p class="site-author-name" itemprop="name">Sing</p>
  <div class="site-description" itemprop="description"></div>
</div>
<div class="site-state-wrap site-overview-item animated">
  <nav class="site-state">
      <div class="site-state-item site-state-posts">
          <a href="/archives">
          <span class="site-state-item-count">18</span>
          <span class="site-state-item-name">日志</span>
        </a>
      </div>
      <div class="site-state-item site-state-categories">
            <a href="/categories/">
        <span class="site-state-item-count">2</span>
        <span class="site-state-item-name">分类</span></a>
      </div>
      <div class="site-state-item site-state-tags">
            <a href="/tags/">
        <span class="site-state-item-count">25</span>
        <span class="site-state-item-name">标签</span></a>
      </div>
  </nav>
</div>



          </div>
        </div>
      </div>
    </div>
  </aside>
  <div class="sidebar-dimmer"></div>


    </header>

    
  <div class="back-to-top" role="button" aria-label="返回顶部">
    <i class="fa fa-arrow-up"></i>
    <span>0%</span>
  </div>

<noscript>
  <div class="noscript-warning">Theme NexT works best with JavaScript enabled</div>
</noscript>


    <div class="main-inner index posts-expand">

    


<div class="post-block">
  
  

  <article itemscope itemtype="http://schema.org/Article" class="post-content" lang="">
    <link itemprop="mainEntityOfPage" href="https://singingxy.github.io/2022/%E4%BD%BF%E7%94%A8sass%E8%BF%9B%E8%A1%8CHSL%E8%AE%A1%E7%AE%97/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/images/avatar.gif">
      <meta itemprop="name" content="Sing">
      <meta itemprop="description" content="">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="sing's blog">
    </span>
      <header class="post-header">
        <h2 class="post-title" itemprop="name headline">
          <a href="/2022/%E4%BD%BF%E7%94%A8sass%E8%BF%9B%E8%A1%8CHSL%E8%AE%A1%E7%AE%97/" class="post-title-link" itemprop="url">使用sass进行HSL计算</a>
        </h2>

        <div class="post-meta-container">
          <div class="post-meta">
    <span class="post-meta-item">
      <span class="post-meta-item-icon">
        <i class="far fa-calendar"></i>
      </span>
      <span class="post-meta-item-text">发表于</span>

      <time title="创建时间：2022-07-07 18:10:25" itemprop="dateCreated datePublished" datetime="2022-07-07T18:10:25+08:00">2022-07-07</time>
    </span>

  
</div>

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">
          <h2 id="什么是HSL"><a href="#什么是HSL" class="headerlink" title="什么是HSL"></a><strong>什么是HSL</strong></h2><p>　　很多朋友都听说过RGB颜色模型，即任何一种颜色，都是由红（Red）、绿（Green）、蓝（Blue）三原色以不同的比例相加而成的。<br>　　但是RGB模型对人类而言并不直观，比如我说一种颜色是由60%红，30%绿和90%蓝组成的，你应该很难想象出来，这到底是哪种颜色？<br>　　因此人们设计出了HSL色彩空间，来更加直观的表达颜色。HSL是色相（Hue）、饱和度（Saturation）和亮度（Lightness）这三个颜色属性的简称。</p>
<p>　　<strong>色相（Hue）是色彩的基本属性，就是人们平常所说的颜色名称，如紫色、青色、品红等等。我们可以在一个圆环上表示出所有的色相。</strong></p>
<p><img src="/2022/%E4%BD%BF%E7%94%A8sass%E8%BF%9B%E8%A1%8CHSL%E8%AE%A1%E7%AE%97/1.png" alt="色相"></p>
<p>　　色环上的0度、120度、240度位置，分别对应了RGB模型的红、绿、蓝三原色。原色两两混合形成了二次色。比如黄色（60度）就是由红色和绿色混合而成；蓝色和绿色则相加形成青色（180度）；品红（300度）则由红蓝两色组成。</p>
<p>　　<strong>饱和度（Saturation）是指色彩的纯度，饱和度越高色彩越纯越浓，饱和度越低则色彩变灰变淡。</strong></p>
<p><img src="/2022/%E4%BD%BF%E7%94%A8sass%E8%BF%9B%E8%A1%8CHSL%E8%AE%A1%E7%AE%97/2.png" alt="饱和度"></p>
<p>　　<strong>亮度（Lightness）指的是色彩的明暗程度，亮度值越高，色彩越白，亮度越低，色彩越黑。</strong></p>
<p><img src="/2022/%E4%BD%BF%E7%94%A8sass%E8%BF%9B%E8%A1%8CHSL%E8%AE%A1%E7%AE%97/3.png" alt="亮度"></p>
<p>　　我们把<strong>色相（Hue）、饱和度（Saturation）和亮度（Lightness）</strong>三个属性整合到一个圆柱中，就形成了HSL色彩空间模型。</p>
<p><img src="/2022/%E4%BD%BF%E7%94%A8sass%E8%BF%9B%E8%A1%8CHSL%E8%AE%A1%E7%AE%97/4.png" alt="HSL色彩空间"></p>
<h2 id="sass中对hsl颜色的计算"><a href="#sass中对hsl颜色的计算" class="headerlink" title="sass中对hsl颜色的计算"></a><strong>sass中对hsl颜色的计算</strong></h2><p><code>adjust-hue($color, $degrees)</code>: 修改给定颜色的色相值。<br>使用-360deg 到 360deg之间的角度，然后返架指定颜色hue旋转这个角度后有颜色(正：顺时针方向，负：逆时针方向)。</p>
<figure class="highlight css"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">adjust-hue(hsl(<span class="number">120</span>, <span class="number">30%</span>, <span class="number">90%</span>), <span class="number">60deg</span>) =&gt; hsl(<span class="number">180</span>, <span class="number">30%</span>, <span class="number">90%</span>)</span><br><span class="line">adjust-hue(hsl(<span class="number">120</span>, <span class="number">30%</span>, <span class="number">90%</span>), -<span class="number">60deg</span>) =&gt; hsl(<span class="number">60</span>, <span class="number">30%</span>, <span class="number">90%</span>)</span><br><span class="line">adjust-hue(<span class="selector-id">#811</span>, <span class="number">45deg</span>) =&gt; <span class="selector-id">#886a11</span></span><br></pre></td></tr></table></figure>

<p><code>lighten($color, $amount)</code>: 使一个颜色更亮。</p>
<figure class="highlight css"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">lighten(hsl(<span class="number">0</span>, <span class="number">0%</span>, <span class="number">0%</span>), <span class="number">30%</span>) =&gt; hsl(<span class="number">0</span>, <span class="number">0</span>, <span class="number">30</span>)</span><br></pre></td></tr></table></figure>
<p><code>darken($color, $amount)</code>: 使一个颜色变暗。</p>
<figure class="highlight css"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">darken(hsl(<span class="number">25</span>, <span class="number">100%</span>, <span class="number">80%</span>), <span class="number">30%</span>) =&gt; hsl(<span class="number">25</span>, <span class="number">100%</span>, <span class="number">50%</span>)</span><br></pre></td></tr></table></figure>

<p><code>saturate($color, $amount)</code>: 使一个颜色更加饱和。<br><code>desaturate($color, $amount)</code>: 减少一个颜色的饱和度。</p>
<p><code>adjust-color($color, [$red], [$green], [$blue], [$hue], [$saturation], [$lightness], [$alpha]) </code>: 对指定的颜色增加或减少相应一个或多个颜色值。</p>
<figure class="highlight css"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">adjust-<span class="attribute">color</span>(<span class="selector-id">#102030</span>, $blue: <span class="number">5</span>) =&gt; <span class="number">#102035</span></span><br><span class="line"><span class="built_in">adjust-color</span>(<span class="number">#102030</span>, $red: -<span class="number">5</span>, $blue: <span class="number">5</span>) =&gt; <span class="number">#0b2035</span></span><br><span class="line"><span class="built_in">adjust-color</span>(<span class="built_in">hsl</span>(<span class="number">25</span>, <span class="number">100%</span>, <span class="number">80%</span>), $lightness: -<span class="number">30%</span>, $alpha: -<span class="number">0.4</span>) =&gt; <span class="built_in">hsla</span>(<span class="number">25</span>, <span class="number">100%</span>, <span class="number">50%</span>, <span class="number">0.6</span>)</span><br></pre></td></tr></table></figure>
<p><code>scale-color($color, [$red], [$green], [$blue], [$saturation], [$lightness], [$alpha]) </code>: 通过调整颜色的一个或者多个属性获取一个流畅颜色。</p>
<figure class="highlight css"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">scale-<span class="attribute">color</span>(hsl(<span class="number">120</span>, <span class="number">70%</span>, <span class="number">80%</span>), $lightness: <span class="number">50%</span>) =&gt; <span class="built_in">hsl</span>(<span class="number">120</span>, <span class="number">70%</span>, <span class="number">90%</span>)</span><br><span class="line"><span class="built_in">scale-color</span>(<span class="built_in">rgb</span>(<span class="number">200</span>, <span class="number">150%</span>, <span class="number">170%</span>), $green: -<span class="number">40%</span>, $blue: <span class="number">70%</span>) =&gt; <span class="built_in">rgb</span>(<span class="number">200</span>, <span class="number">90</span>, <span class="number">229</span>)</span><br><span class="line"><span class="built_in">scale-color</span>(<span class="built_in">hsl</span>(<span class="number">200</span>, <span class="number">70%</span>, <span class="number">80%</span>), $saturation: -<span class="number">90%</span>, $alpha: -<span class="number">30%</span>) =&gt; <span class="built_in">hsla</span>(<span class="number">200</span>, <span class="number">7%</span>, <span class="number">80%</span>, <span class="number">0.7</span>)</span><br></pre></td></tr></table></figure>
<p><code>change-color($color, [$red], [$green], [$blue], [$hue], [$saturation], [$lightness], [$alpha]) </code>: 在该函数中传入的参数将直接替换原来的值，而不做任何的运算。</p>
<figure class="highlight css"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">change-<span class="attribute">color</span>(<span class="selector-id">#102030</span>, $blue: <span class="number">5</span>) =&gt; <span class="number">#102005</span></span><br><span class="line"><span class="built_in">change-color</span>(<span class="number">#102030</span>, $red: <span class="number">120</span>, $blue: <span class="number">5</span>) =&gt; <span class="number">#782005</span></span><br><span class="line"><span class="built_in">change-color</span>(<span class="built_in">hsl</span>(<span class="number">25</span>, <span class="number">100%</span>, <span class="number">80%</span>), $lightness: <span class="number">40%</span>, $alpha: <span class="number">0.8</span>) =&gt; <span class="built_in">hsla</span>(<span class="number">25</span>, <span class="number">100%</span>, <span class="number">40%</span>, <span class="number">0.8</span>)</span><br></pre></td></tr></table></figure>
<h2 id="项目中的实际应用"><a href="#项目中的实际应用" class="headerlink" title="项目中的实际应用"></a><strong>项目中的实际应用</strong></h2><p>比如智慧医院里有个功能叫“预问诊报告”，患者信息的部分有一个渐变。通过对当前主题色进行HSL计算，可以得到一个和UI几乎一致的渐变颜色效果。</p>
<figure class="highlight css"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><span class="line"><span class="selector-class">.user-info</span> &#123;</span><br><span class="line">  <span class="attribute">padding</span>: <span class="number">0</span> <span class="number">30</span>rpx;</span><br><span class="line">  <span class="attribute">background</span>: <span class="built_in">linear-gradient</span>(<span class="number">180deg</span>, <span class="built_in">hsl</span>(<span class="number">164</span>, <span class="number">94%</span>, <span class="number">34%</span>) <span class="number">0%</span>, <span class="built_in">hsl</span>(<span class="number">180</span>, <span class="number">100%</span>, <span class="number">30%</span>) <span class="number">100%</span>);</span><br><span class="line">  <span class="attribute">opacity</span>: <span class="number">0.8</span>;</span><br><span class="line">  <span class="attribute">border-radius</span>: <span class="number">20</span>rpx;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>

<p>UI图</p>
<p><img src="/2022/%E4%BD%BF%E7%94%A8sass%E8%BF%9B%E8%A1%8CHSL%E8%AE%A1%E7%AE%97/5.png" alt="图片5.png#283px #371px"></p>
<p>HSL计算效果</p>
<p><img src="/2022/%E4%BD%BF%E7%94%A8sass%E8%BF%9B%E8%A1%8CHSL%E8%AE%A1%E7%AE%97/6.png" alt="图片6.png#277px #371px"></p>

      
    </div>

    
    
    

    <footer class="post-footer">
        <div class="post-eof"></div>
      
    </footer>
  </article>
</div>




    


<div class="post-block">
  
  

  <article itemscope itemtype="http://schema.org/Article" class="post-content" lang="">
    <link itemprop="mainEntityOfPage" href="https://singingxy.github.io/2021/%E4%B8%80%E4%B8%AAnext%E4%B8%BB%E9%A2%98%E7%89%88%E6%9C%AC%E4%BA%A7%E7%94%9F%E7%9A%84%E9%94%99%E8%AF%AF/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/images/avatar.gif">
      <meta itemprop="name" content="Sing">
      <meta itemprop="description" content="">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="sing's blog">
    </span>
      <header class="post-header">
        <h2 class="post-title" itemprop="name headline">
          <a href="/2021/%E4%B8%80%E4%B8%AAnext%E4%B8%BB%E9%A2%98%E7%89%88%E6%9C%AC%E4%BA%A7%E7%94%9F%E7%9A%84%E9%94%99%E8%AF%AF/" class="post-title-link" itemprop="url">一个next主题版本产生的错误</a>
        </h2>

        <div class="post-meta-container">
          <div class="post-meta">
    <span class="post-meta-item">
      <span class="post-meta-item-icon">
        <i class="far fa-calendar"></i>
      </span>
      <span class="post-meta-item-text">发表于</span>

      <time title="创建时间：2021-07-12 17:28:50" itemprop="dateCreated datePublished" datetime="2021-07-12T17:28:50+08:00">2021-07-12</time>
    </span>

  
</div>

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">
          <p>github 报了安全警报，又到了升级的时候。<br>于是升级 hexo，升级完运行<code>hexo server</code>的时候，出来的不是我的博客界面，而是未生成的模板</p>
<figure class="highlight html"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br></pre></td><td class="code"><pre><span class="line">&#123;% extends &#x27;_layout.swig&#x27; %&#125; &#123;% import &#x27;_macro/post.swig&#x27; as post_template %&#125; &#123;% import &#x27;_macro/sidebar.swig&#x27; as</span><br><span class="line">sidebar_template %&#125; &#123;% block title %&#125;&#123;&#123; config.title &#125;&#125;&#123;% if theme.index_with_subtitle and config.subtitle %&#125; -</span><br><span class="line">&#123;&#123;config.subtitle &#125;&#125;&#123;% endif %&#125;&#123;% endblock %&#125; &#123;% block page_class %&#125; &#123;% if is_home() %&#125;page-home&#123;% endif -%&#125; &#123;% endblock</span><br><span class="line">%&#125; &#123;% block content %&#125;</span><br><span class="line"><span class="tag">&lt;<span class="name">section</span> <span class="attr">id</span>=<span class="string">&quot;posts&quot;</span> <span class="attr">class</span>=<span class="string">&quot;posts-expand&quot;</span>&gt;</span></span><br><span class="line">  &#123;% for post in page.posts %&#125; &#123;&#123; post_template.render(post, true) &#125;&#125; &#123;% endfor %&#125;</span><br><span class="line"><span class="tag">&lt;/<span class="name">section</span>&gt;</span></span><br><span class="line"></span><br><span class="line">&#123;% include &#x27;_partials/pagination.swig&#x27; %&#125; &#123;% endblock %&#125; &#123;% block sidebar %&#125; &#123;&#123; sidebar_template.render(false) &#125;&#125; &#123;%</span><br><span class="line">endblock %&#125;</span><br></pre></td></tr></table></figure>

<p>这不就废了嘛，以为是 guthub 访问不畅文件下载不全，又重新下了两次，依然是这样。<br>经过搜索后得到答案，需要下载更高版本的 next 主题<br>下载最新版的方法可以参考<a target="_blank" rel="noopener" href="https://theme-next.js.org/docs/getting-started/installation.html">https://theme-next.js.org/docs/getting-started/installation.html</a><br>直接下了个最新版的 next 主题，运行<code>hexo server</code>，漂亮的主题回来了。</p>
<p>关于 next 主题还有一些事没有完成<br>个性化定制的 next 文件还是应该同步到 github 上面存放，不然换个电脑就没了，得找时间完善这个事。</p>

      
    </div>

    
    
    

    <footer class="post-footer">
        <div class="post-eof"></div>
      
    </footer>
  </article>
</div>




    


<div class="post-block">
  
  

  <article itemscope itemtype="http://schema.org/Article" class="post-content" lang="">
    <link itemprop="mainEntityOfPage" href="https://singingxy.github.io/2021/Windows%E4%B8%8B%E4%BD%BF%E7%94%A8GitBash%E6%80%8E%E4%B9%88%E9%80%89%E6%8B%A9%E9%80%89%E9%A1%B9/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/images/avatar.gif">
      <meta itemprop="name" content="Sing">
      <meta itemprop="description" content="">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="sing's blog">
    </span>
      <header class="post-header">
        <h2 class="post-title" itemprop="name headline">
          <a href="/2021/Windows%E4%B8%8B%E4%BD%BF%E7%94%A8GitBash%E6%80%8E%E4%B9%88%E9%80%89%E6%8B%A9%E9%80%89%E9%A1%B9/" class="post-title-link" itemprop="url">Windows下使用GitBash运行vue/cli怎么选择选项</a>
        </h2>

        <div class="post-meta-container">
          <div class="post-meta">
    <span class="post-meta-item">
      <span class="post-meta-item-icon">
        <i class="far fa-calendar"></i>
      </span>
      <span class="post-meta-item-text">发表于</span>

      <time title="创建时间：2021-02-17 09:23:28" itemprop="dateCreated datePublished" datetime="2021-02-17T09:23:28+08:00">2021-02-17</time>
    </span>
    <span class="post-meta-item">
      <span class="post-meta-item-icon">
        <i class="far fa-folder"></i>
      </span>
      <span class="post-meta-item-text">分类于</span>
        <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
          <a href="/categories/%E5%B0%8F%E9%97%AE%E9%A2%98/" itemprop="url" rel="index"><span itemprop="name">小问题</span></a>
        </span>
    </span>

  
</div>

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">
          <p>使用 Vue CLI 时，我们用<code>vue create hello-world</code>来创建一个新的 vue 项目。<br>但是如果在 Windows 下使用 Git Bash 来运行这个命令，是不能进行选择的。<br>这是文档上的警告，同时也是解决方法：</p>
<blockquote>
<p>警告<br>如果你在 Windows 上通过 minTTY 使用 Git Bash，交互提示符并不工作。<br>你必须通过<code> winpty vue.cmd create hello-world</code> 启动这个命令。<br>不过，如果你仍想使用 <code>vue create hello-world</code>，则可以通过在 ~/.bashrc 文件中添加以下行来为命令添加别名。 alias vue=’winpty vue.cmd’ 你需要重新启动 Git Bash 终端会话以使更新后的 &gt; bashrc 文件生效。</p>
</blockquote>
<p>用 vue/cli 新建项目时需要注意一下。</p>

      
    </div>

    
    
    

    <footer class="post-footer">
        <div class="post-eof"></div>
      
    </footer>
  </article>
</div>




    


<div class="post-block">
  
  

  <article itemscope itemtype="http://schema.org/Article" class="post-content" lang="">
    <link itemprop="mainEntityOfPage" href="https://singingxy.github.io/2020/vue-cil3-sass/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/images/avatar.gif">
      <meta itemprop="name" content="Sing">
      <meta itemprop="description" content="">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="sing's blog">
    </span>
      <header class="post-header">
        <h2 class="post-title" itemprop="name headline">
          <a href="/2020/vue-cil3-sass/" class="post-title-link" itemprop="url">Vue CLI 3 自动化导入，配置sass全局变量</a>
        </h2>

        <div class="post-meta-container">
          <div class="post-meta">
    <span class="post-meta-item">
      <span class="post-meta-item-icon">
        <i class="far fa-calendar"></i>
      </span>
      <span class="post-meta-item-text">发表于</span>

      <time title="创建时间：2020-03-25 13:30:17" itemprop="dateCreated datePublished" datetime="2020-03-25T13:30:17+08:00">2020-03-25</time>
    </span>
    <span class="post-meta-item">
      <span class="post-meta-item-icon">
        <i class="far fa-folder"></i>
      </span>
      <span class="post-meta-item-text">分类于</span>
        <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
          <a href="/categories/%E5%B0%8F%E9%97%AE%E9%A2%98/" itemprop="url" rel="index"><span itemprop="name">小问题</span></a>
        </span>
    </span>

  
</div>

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">
          <p>使用 sass\less\Stylus 等预处理器时要定义一些全局变量、mixin，组件内使用是需要 import 进去的，每个文件都 import 一次很麻烦，所以需要使用自动化导入来帮我们处理。</p>
          <!--noindex-->
            <div class="post-button">
              <a class="btn" href="/2020/vue-cil3-sass/#more" rel="contents">
                阅读全文 &raquo;
              </a>
            </div>
          <!--/noindex-->
        
      
    </div>

    
    
    

    <footer class="post-footer">
        <div class="post-eof"></div>
      
    </footer>
  </article>
</div>




    


<div class="post-block">
  
  

  <article itemscope itemtype="http://schema.org/Article" class="post-content" lang="">
    <link itemprop="mainEntityOfPage" href="https://singingxy.github.io/2020/node-sass/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/images/avatar.gif">
      <meta itemprop="name" content="Sing">
      <meta itemprop="description" content="">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="sing's blog">
    </span>
      <header class="post-header">
        <h2 class="post-title" itemprop="name headline">
          <a href="/2020/node-sass/" class="post-title-link" itemprop="url">安装 node-sass 失败的解决方法</a>
        </h2>

        <div class="post-meta-container">
          <div class="post-meta">
    <span class="post-meta-item">
      <span class="post-meta-item-icon">
        <i class="far fa-calendar"></i>
      </span>
      <span class="post-meta-item-text">发表于</span>

      <time title="创建时间：2020-03-25 13:04:06" itemprop="dateCreated datePublished" datetime="2020-03-25T13:04:06+08:00">2020-03-25</time>
    </span>
    <span class="post-meta-item">
      <span class="post-meta-item-icon">
        <i class="far fa-folder"></i>
      </span>
      <span class="post-meta-item-text">分类于</span>
        <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
          <a href="/categories/%E5%B0%8F%E9%97%AE%E9%A2%98/" itemprop="url" rel="index"><span itemprop="name">小问题</span></a>
        </span>
    </span>

  
</div>

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">
          <p>如果已经安装失败了，先卸载</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">npm uninstall node-sass</span><br></pre></td></tr></table></figure>
          <!--noindex-->
            <div class="post-button">
              <a class="btn" href="/2020/node-sass/#more" rel="contents">
                阅读全文 &raquo;
              </a>
            </div>
          <!--/noindex-->
        
      
    </div>

    
    
    

    <footer class="post-footer">
        <div class="post-eof"></div>
      
    </footer>
  </article>
</div>




    


<div class="post-block">
  
  

  <article itemscope itemtype="http://schema.org/Article" class="post-content" lang="">
    <link itemprop="mainEntityOfPage" href="https://singingxy.github.io/2020/update-hexo/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/images/avatar.gif">
      <meta itemprop="name" content="Sing">
      <meta itemprop="description" content="">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="sing's blog">
    </span>
      <header class="post-header">
        <h2 class="post-title" itemprop="name headline">
          <a href="/2020/update-hexo/" class="post-title-link" itemprop="url">升级了hexo，顺便换成了next主题</a>
        </h2>

        <div class="post-meta-container">
          <div class="post-meta">
    <span class="post-meta-item">
      <span class="post-meta-item-icon">
        <i class="far fa-calendar"></i>
      </span>
      <span class="post-meta-item-text">发表于</span>

      <time title="创建时间：2020-03-18 10:38:31" itemprop="dateCreated datePublished" datetime="2020-03-18T10:38:31+08:00">2020-03-18</time>
    </span>
    <span class="post-meta-item">
      <span class="post-meta-item-icon">
        <i class="far fa-folder"></i>
      </span>
      <span class="post-meta-item-text">分类于</span>
        <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
          <a href="/categories/%E5%B0%8F%E9%97%AE%E9%A2%98/" itemprop="url" rel="index"><span itemprop="name">小问题</span></a>
        </span>
    </span>

  
</div>

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">
          <h2 id="升级-hexo"><a href="#升级-hexo" class="headerlink" title="升级 hexo"></a>升级 hexo</h2><p>起因是 Github 报了一个依赖包的漏洞警告，想着顺便升级一下吧。<br>尝试了修改 dependencies 里版本号的方法，不出所料的坑了，install 以后 server 没启动起来。<br>索性新建了一个目录重新 <code>hexo init</code> 一个出来 ，把 <code>source</code> 里的数据复制回来，大功告成。再看报漏洞的那个依赖包，已经自动升级了。</p>
          <!--noindex-->
            <div class="post-button">
              <a class="btn" href="/2020/update-hexo/#more" rel="contents">
                阅读全文 &raquo;
              </a>
            </div>
          <!--/noindex-->
        
      
    </div>

    
    
    

    <footer class="post-footer">
        <div class="post-eof"></div>
      
    </footer>
  </article>
</div>




    


<div class="post-block">
  
  

  <article itemscope itemtype="http://schema.org/Article" class="post-content" lang="">
    <link itemprop="mainEntityOfPage" href="https://singingxy.github.io/2020/vscode-eslint/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/images/avatar.gif">
      <meta itemprop="name" content="Sing">
      <meta itemprop="description" content="">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="sing's blog">
    </span>
      <header class="post-header">
        <h2 class="post-title" itemprop="name headline">
          <a href="/2020/vscode-eslint/" class="post-title-link" itemprop="url">VSCode升级，ESLint自动修复的设置更新</a>
        </h2>

        <div class="post-meta-container">
          <div class="post-meta">
    <span class="post-meta-item">
      <span class="post-meta-item-icon">
        <i class="far fa-calendar"></i>
      </span>
      <span class="post-meta-item-text">发表于</span>

      <time title="创建时间：2020-01-14 13:20:27" itemprop="dateCreated datePublished" datetime="2020-01-14T13:20:27+08:00">2020-01-14</time>
    </span>
    <span class="post-meta-item">
      <span class="post-meta-item-icon">
        <i class="far fa-folder"></i>
      </span>
      <span class="post-meta-item-text">分类于</span>
        <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
          <a href="/categories/%E5%B0%8F%E9%97%AE%E9%A2%98/" itemprop="url" rel="index"><span itemprop="name">小问题</span></a>
        </span>
    </span>

  
</div>

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">
          <p>VS Code 升级后有关 ESlint 自动修复的配置有变更。<br>在<code>settings.json</code>文件中发现了如下报错<br><img src="/2020/vscode-eslint/1.png"><br>这个设置项已经弃用了，请使用 <code>editor.codeActionsOnSave</code> 和 <code>source.fixAll.eslint</code>。</p>
          <!--noindex-->
            <div class="post-button">
              <a class="btn" href="/2020/vscode-eslint/#more" rel="contents">
                阅读全文 &raquo;
              </a>
            </div>
          <!--/noindex-->
        
      
    </div>

    
    
    

    <footer class="post-footer">
        <div class="post-eof"></div>
      
    </footer>
  </article>
</div>




    


<div class="post-block">
  
  

  <article itemscope itemtype="http://schema.org/Article" class="post-content" lang="">
    <link itemprop="mainEntityOfPage" href="https://singingxy.github.io/2020/flex/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/images/avatar.gif">
      <meta itemprop="name" content="Sing">
      <meta itemprop="description" content="">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="sing's blog">
    </span>
      <header class="post-header">
        <h2 class="post-title" itemprop="name headline">
          <a href="/2020/flex/" class="post-title-link" itemprop="url">flex布局</a>
        </h2>

        <div class="post-meta-container">
          <div class="post-meta">
    <span class="post-meta-item">
      <span class="post-meta-item-icon">
        <i class="far fa-calendar"></i>
      </span>
      <span class="post-meta-item-text">发表于</span>

      <time title="创建时间：2020-01-02 09:15:30" itemprop="dateCreated datePublished" datetime="2020-01-02T09:15:30+08:00">2020-01-02</time>
    </span>
    <span class="post-meta-item">
      <span class="post-meta-item-icon">
        <i class="far fa-folder"></i>
      </span>
      <span class="post-meta-item-text">分类于</span>
        <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
          <a href="/categories/%E7%AC%94%E8%AE%B0/" itemprop="url" rel="index"><span itemprop="name">笔记</span></a>
        </span>
    </span>

  
</div>

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">
          <p>flex（ Flexible Box：弹性布局盒模型），用来为盒模型提供最大的灵活性。任何一个容器都可以指定为 Flex 布局。可以做到简便、完整、响应式地实现各种页面布局。</p>
<h3 id="使用-flex-布局的优势"><a href="#使用-flex-布局的优势" class="headerlink" title="使用 flex 布局的优势"></a>使用 flex 布局的优势</h3><ol>
<li>可在不同方向排列元素</li>
<li>控制元素排序的方向</li>
<li>控制元素的对齐方式</li>
<li>控制元素之间等距</li>
</ol>
          <!--noindex-->
            <div class="post-button">
              <a class="btn" href="/2020/flex/#more" rel="contents">
                阅读全文 &raquo;
              </a>
            </div>
          <!--/noindex-->
        
      
    </div>

    
    
    

    <footer class="post-footer">
        <div class="post-eof"></div>
      
    </footer>
  </article>
</div>




    


<div class="post-block">
  
  

  <article itemscope itemtype="http://schema.org/Article" class="post-content" lang="">
    <link itemprop="mainEntityOfPage" href="https://singingxy.github.io/2019/Introduction-to-MVVM/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/images/avatar.gif">
      <meta itemprop="name" content="Sing">
      <meta itemprop="description" content="">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="sing's blog">
    </span>
      <header class="post-header">
        <h2 class="post-title" itemprop="name headline">
          <a href="/2019/Introduction-to-MVVM/" class="post-title-link" itemprop="url">理解MVVM</a>
        </h2>

        <div class="post-meta-container">
          <div class="post-meta">
    <span class="post-meta-item">
      <span class="post-meta-item-icon">
        <i class="far fa-calendar"></i>
      </span>
      <span class="post-meta-item-text">发表于</span>

      <time title="创建时间：2019-12-28 09:49:41" itemprop="dateCreated datePublished" datetime="2019-12-28T09:49:41+08:00">2019-12-28</time>
    </span>
    <span class="post-meta-item">
      <span class="post-meta-item-icon">
        <i class="far fa-folder"></i>
      </span>
      <span class="post-meta-item-text">分类于</span>
        <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
          <a href="/categories/%E7%AC%94%E8%AE%B0/" itemprop="url" rel="index"><span itemprop="name">笔记</span></a>
        </span>
    </span>

  
</div>

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">
          <p>MVVM 是由 MVC 发展而来，通过在 Model 之上而在 View 之下增加一个非视觉的组件将来自 Model 的数据映射到 View 中。</p>
          <!--noindex-->
            <div class="post-button">
              <a class="btn" href="/2019/Introduction-to-MVVM/#more" rel="contents">
                阅读全文 &raquo;
              </a>
            </div>
          <!--/noindex-->
        
      
    </div>

    
    
    

    <footer class="post-footer">
        <div class="post-eof"></div>
      
    </footer>
  </article>
</div>




    


<div class="post-block">
  
  

  <article itemscope itemtype="http://schema.org/Article" class="post-content" lang="">
    <link itemprop="mainEntityOfPage" href="https://singingxy.github.io/2019/sshKey-Git/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/images/avatar.gif">
      <meta itemprop="name" content="Sing">
      <meta itemprop="description" content="">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="sing's blog">
    </span>
      <header class="post-header">
        <h2 class="post-title" itemprop="name headline">
          <a href="/2019/sshKey-Git/" class="post-title-link" itemprop="url">使用ssh连接Git仓库(Github\GitLab\CODING\码云等)</a>
        </h2>

        <div class="post-meta-container">
          <div class="post-meta">
    <span class="post-meta-item">
      <span class="post-meta-item-icon">
        <i class="far fa-calendar"></i>
      </span>
      <span class="post-meta-item-text">发表于</span>

      <time title="创建时间：2019-12-23 08:22:16" itemprop="dateCreated datePublished" datetime="2019-12-23T08:22:16+08:00">2019-12-23</time>
    </span>
    <span class="post-meta-item">
      <span class="post-meta-item-icon">
        <i class="far fa-folder"></i>
      </span>
      <span class="post-meta-item-text">分类于</span>
        <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
          <a href="/categories/%E7%AC%94%E8%AE%B0/" itemprop="url" rel="index"><span itemprop="name">笔记</span></a>
        </span>
    </span>

  
</div>

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">
          <p>总的说主要操作是在本地生成 ssh Key，然后把 ssh Key 添加到 Github/GitLab 的账户上，完成连接。</p>
          <!--noindex-->
            <div class="post-button">
              <a class="btn" href="/2019/sshKey-Git/#more" rel="contents">
                阅读全文 &raquo;
              </a>
            </div>
          <!--/noindex-->
        
      
    </div>

    
    
    

    <footer class="post-footer">
        <div class="post-eof"></div>
      
    </footer>
  </article>
</div>




  <nav class="pagination">
    <span class="page-number current">1</span><a class="page-number" href="/page/2/">2</a><a class="extend next" rel="next" href="/page/2/"><i class="fa fa-angle-right" aria-label="下一页"></i></a>
  </nav>

</div>
  </main>

  <footer class="footer">
    <div class="footer-inner">


<div class="copyright">
  &copy; 
  <span itemprop="copyrightYear">2022</span>
  <span class="with-love">
    <i class="fa fa-heart"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">Sing</span>
</div>
  <div class="powered-by">由 <a href="https://hexo.io/" rel="noopener" target="_blank">Hexo</a> & <a href="https://theme-next.js.org/" rel="noopener" target="_blank">NexT.Gemini</a> 强力驱动
  </div>

    </div>
  </footer>

  
  <script src="https://cdn.jsdelivr.net/npm/animejs@3.2.1/lib/anime.min.js" integrity="sha256-XL2inqUJaslATFnHdJOi9GfQ60on8Wx1C2H8DYiN1xY=" crossorigin="anonymous"></script>
<script src="/js/comments.js"></script><script src="/js/utils.js"></script><script src="/js/motion.js"></script><script src="/js/next-boot.js"></script>

  




  





</body>
</html>
